import request from '@/router/axios';

// 禁用店铺
export const disableShop = (id) => {
  return request({
    url: `/supplier/manager/store/disable/${id}`,
    method: 'put',
  });
};

// 开启店铺
export const enableBrand = (id) => {
  return request({
    url: `/supplier/manager/store/enable/${id}`,
    method: 'put',
  });
};

// 查询店铺详细
export const getShopDetailData = (id, params) => {
  return request({
    url: `/supplier/manager/store/get/detail/${id}`,
    method: 'get',
    params: params,
  });
};

// // 增加店铺列表
// export const shopAdd = (params) => {
//   return request({
//     url: '/manager/store/add',
//     method: 'post',
//     data: params
//   })
// }

// // 修改店铺
// export const shopEdit = (id, params) => {
//   return request({
//     url: `/manager/store/edit/${id}`,
//     method: 'put',
//     data: params
//   })
// }

// 审核店铺
export const shopAudit = (id, passed) => {
  return request({
    url: `/supplier/manager/store/audit/${id}/${passed}`,
    method: 'put',
  });
};

// // 获取结算单分页
// export const getBuyBillPage = (params) => {
//   return request({
//     url: `/manager/store/bill/getByPage`,
//     method: 'get',
//     params: params
//   })
// }

// // 获取结算单详情
// export const getBuyBillDetail = (id) => {
//   return request({
//     url: `/manager/store/bill/get/${id}`,
//     method: 'get'
//   })
// }

// // 获取商家结算单流水分页
// export const getStoreFlow = (id, params) => {
//   return request({
//     url: `/manager/store/bill/${id}/getStoreFlow`,
//     method: 'get',
//     params: params
//   })
// }

// // 获取所有商家
// export const getShopList = () => {
//   return request({
//     url: `/manager/store/all`,
//     method: 'get'
//   })
// }

// 查询店铺列表
export const getShopListData = (params) => {
  return request({
    contentType: 'application/x-www-form-urlencoded',
    url: `/supplier/manager/store`,
    method: 'get',
    params: params,
  });
};

// 查询店铺及小程序相关信息
export const getStoreInfo = (params) => {
  return request({
    url: `/system/store/config`,
    method: 'get',
    params: params,
  });
};
// 新增店铺及小程序相关信息
export const addStoreInfo = (params) => {
  return request({
    url: `/system/store/config`,
    method: 'post',
    data: params,
  });
};
// 修改店铺及小程序相关信息
export const updateStoreInfo = (params) => {
  return request({
    url: `/system/store/config`,
    method: 'put',
    data: params,
  });
};
